{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "936efe03",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "5f034e1d",
   "metadata": {},
   "outputs": [],
   "source": [
    "dc={'service_type':['212c','2g','3g','4g','2g','3g'],'2_total_fee':[1,3,'34.0','tuu','','34'],'3_total_fee':[12,45,None,56.0,'45','wer']}\n",
    "df=pd.DataFrame(dc)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "8731f568",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAAWFUlEQVR4nO3df5DcdX3H8efLGDBNaAgGt0wSSRwzo+gVkG1iB6sbK+FAS9oRxzARiSM9xxp/xnaCnYE2+AfWiXZEFE5No53IaQUkmoyYEU5qEU2CkSPBSIxpyUlJJRg5yMAcvPvHfuNsjrvb7+599/b47Osxs5P9fr6fz/f72c/n8rrvfu+7+1VEYGZm6XpRuztgZmat5aA3M0ucg97MLHEOejOzxDnozcwS9+J2d2A0c+fOjYULFzbV9sknn2TmzJnFdsgmxHMyNXlepp6JzMmuXbt+GxGnj7ZuSgb9woUL2blzZ1Nt+/v7qVQqxXbIJsRzMjV5XqaeicyJpP8ea51P3ZiZJc5Bb2aWOAe9mVniHPRmZolz0JuZJc5Bb2aWuLpBL2mBpLsk7ZW0R9KHR6kjSZ+TtF/S/ZJeV7PuCkkPZY8rin4BZmY2vjzX0Q8DayPiPkmnALskbY+IvTV1LgIWZ4+lwB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vc56r+G6rdovi8rej1wd/blakTEkVb11U6cL6o/Z6dExI+z1V9vV786VUQ8m/2SnU/1iwXLwIHj/x+Am9vVt04k6W3A4YjYVVP8Klo0J1Pmu27Gk51XvAXYHBG35qg/H7gNeHdE/KrV/bMTjZwvSae2uUuWiYjfSbqL6oGPtc/5wCWSLgZeAvwx8MlW7WzKH9Fnf0j6CvBgRHwmR/1Tga3Auoj4r5pV9wJvzL6KAUmntaC7HW+0+YqI3wFPSDr+racr29S9jiTp9OO/bCXNAC4A9gGvqLlJ0Dvb07vOFBFXRcT8iFhI9f/DnVRPJ7dkTl4IR/TnA5cDA9k5RoBPACcD11M9j7VV0u6IuBBYA7wSuFrS1Vn95RFxOPsq5FslvYjqucoLJvF1dIqx5uu9wJckPQf8EDjanu51pDOAr2Y3/XkR8M2I+E71dzLfk/Qk1e+0sjaKiGOS/o4WzMmUv7zS0iBp1vErP1S9HeUZEeFr7Nvo+Jxk78JuAB6KiM+2u1+drFVzMuVP3Vgy3ppdWvkA8Be08Hyk5fa32buuPVS/Wvym9nbHaNGc+IjezCxxPqI3M0ucg97MLHEOejOzxDnozcwS56A3M0vc/wOkuSJcFpYywgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "df['service_type'].hist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "0c1e75fe",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3    tuu\n",
      "4       \n",
      "Name: 2_total_fee, dtype: object\n",
      "2    None\n",
      "5     wer\n",
      "Name: 3_total_fee, dtype: object\n"
     ]
    }
   ],
   "source": [
    "def is_num(s):\n",
    "    try:\n",
    "        s=float(s)\n",
    "    except:\n",
    "        return False\n",
    "    return True\n",
    "print(df['2_total_fee'][~df['2_total_fee'].astype('string').apply(is_num)])\n",
    "print(df['3_total_fee'][~df['3_total_fee'].astype('string').apply(is_num)])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "8207d28b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "34.0"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "float('34.0')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "60882660",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3    tuu\n",
       "Name: 2_total_fee, dtype: object"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['2_total_fee'][~df['2_total_fee'].astype('string').apply(is_num)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "3e39b9c0",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "float() argument must be a string or a real number, not 'NoneType'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[0;32mIn [33]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;43mfloat\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\n",
      "\u001b[0;31mTypeError\u001b[0m: float() argument must be a string or a real number, not 'NoneType'"
     ]
    }
   ],
   "source": [
    "float(None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "baa0c783",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
